﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Capricornus;
using DevExpress.Web.ASPxEditors;
using DevExpress.Web.ASPxHtmlEditor;

namespace NewSchoolWeb
{
    public partial class Dygzlh : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            e.NewValues["ID_DYGZJH"] = Common.GetId();

            e.NewValues["ID_TEACHERS"] = "...";

            e.NewValues["CONTENT"] = GetText();
        }

        protected string GetText()
        {
            var edit = ASPxGridView1.FindEditRowCellTemplateControl(ASPxGridView1.DataColumns["CONTENT"],"html1") as ASPxHtmlEditor;

            return edit.Html;
        }

        protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            e.NewValues["ID_TEACHERS"] = "...";

            e.NewValues["CONTENT"] = GetText();
        }

        protected void ASPxGridView1_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e)
        {
            e.NewValues["CJRQ"] = DateTime.Now;
        }
       
    }
}